#!/usr/bin/env node

const http =require('https');
const user=process.argv[2];
const addr = 'http://www.baidu.com';

http.get(addr,(res)=>{
    console.log(`HTTP/${res.httpVersion} ${res.statusCode}${res.statusMessage}`);

    console.log(res.headers);
    console.log();
    let data='';
    res.on('data',(chunk)=>{
        data+=chunk;
    });
    res.on('end',()=>{  
        data=JSON.parse(data);
     });

});

